﻿using System.IO;
using System.Threading.Tasks;

namespace Wallpaper.Services.IService
{
    /// <summary>
    /// MinIO 文件存储服务接口
    /// </summary>
    public interface IMinioService
    {
        /// <summary>
        /// 上传文件到 MinIO
        /// </summary>
        /// <param name="objectName">对象名称（包含路径）</param>
        /// <param name="fileStream">文件流</param>
        /// <param name="contentType">文件内容类型</param>
        /// <returns>上传成功返回 true</returns>
        Task<bool> UploadFileAsync(string objectName, Stream fileStream, string contentType);

        /// <summary>
        /// 下载文件从 MinIO
        /// </summary>
        /// <param name="objectName">对象名称</param>
        /// <returns>文件流</returns>
        Task<Stream> GetFileAsync(string objectName);

        /// <summary>
        /// 从 MinIO 删除文件
        /// </summary>
        /// <param name="objectName">对象名称</param>
        /// <returns>删除成功返回 true</returns>
        Task<bool> RemoveFileAsync(string objectName);

        /// <summary>
        /// 检查文件是否存在
        /// </summary>
        /// <param name="objectName">对象名称</param>
        /// <returns>文件存在返回 true</returns>
        Task<bool> FileExistsAsync(string objectName);

        /// <summary>
        /// 获取文件访问 URL（适用于公开存储桶）
        /// </summary>
        /// <param name="objectName">对象名称</param>
        /// <returns>文件访问 URL</returns>
        string GetFileUrl(string objectName);
    }
}